
output1=open("train.txt","w")
output2=open("val.txt","w")
count=0
with open('all.txt') as f:
    for line1 in f:
        if count%10==0:
            output2.write(line1)
        else:
            output1.write(line1)
        print(line1)
        count+=1
output1.close()
output2.close()